﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Css
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="JsCss" runat="server">
    <!--style-->
    <style type="text/css">
        .outer_inlinediv
        {
            background: none repeat scroll 0 0 #E3EEF8;
            display: inline;
            float: left;
            padding: 6px;
            width: 430px;
        }
        .outer_div
        {
            background: none repeat scroll 0 0 #E3EEF8;
            display: block;
            padding: 6px;
            width: 430px;
        }
        .box_contain_blue
        {
            background: none repeat scroll 0 0 #FFFFFF;
            border: 1px solid #99BEE2;
        }
        .box_title_blue
        {
            background: none repeat scroll 0 0 #B3CFE9;
            color: #005EAC;
            font-weight: bold;
            padding: 2px 8px;
        }
        .box_cont_blue
        {
            padding: 25px;
            text-align: center;
        }
        .box_cont_blue p
        {
            margin-bottom: 15px;
        }
        .box_ico_friend
        {
            background: url("../../content/images/bg_step.gif") no-repeat scroll 0 0 transparent;
            background-position: 0 0;
            height: 49px;
            width: 43px;
            margin-left: 130px;
        }
        #box_foot_blue
        {
            clear: none;
            display: block;
            float: left;
            width: 100%;
        }
        .btn_green
        {
            background-position: 0 0;
            padding-left: 8px;
        }
        a.btn_green
        {
            color: #476DA4;
            text-decoration: none;
        }
        .btn_green em
        {
            background: url("../../content/images/btn_loop.jpg") no-repeat scroll 0 0 transparent;
            font-weight: bold;
            color: #FFFFFF;
            display: inline-block;
            height: 27px;
            text-align: left;
            line-height: 25px;
            padding: 0px 8px 0px 8px;
            margin-top: 5px;
        }
    </style>
    <%-- javascript--%>
    <script language="javascript">
         

            function doopenbox() {
                $.box.confirmx("提示", "确定要打开吗？", function (v, m, f) {
                    //$.box.tip("正在处理...");
                    //$.box.alert('hello', 3000);
                    admin.ui.iframeurl = $('#txt_url').val();
                    $.box.openx("hello", "url:"+admin.ui.iframeurl, 800, 600);
                    $.box.close();
//                    $.box.tip('111', 1500, {
//                        closed: function () { location.reload(); }
//                    });
                 });
               
            }
            function doopen() {               
                admin.ui.iframeurl = $('#txt_url').val();
                admin.ui.goUrl();
            }
            function dopost() {
                var username = $('#txt_UserName').val();               
                var data = { username: username };
                $('#login-tip').html('正在处理，请稍后...');
//                $.doPost('/Home/JsonAjax', data, function (result) {                
//                    //$('#login-tip').html('处理成功，' + result.error_message);                   
//                    alert('sds');

//                });
                $.doPostJson('/Home/JsonAjax', data, function (result) {
                    if (result) {
                        $('#login-tip').html($.subStr(0,20,username+":"+result.error_message));     
                    }                 

                });
             

            }

            function Charge() {
                var username = $('#txt_username').val();
                var money = $('#txt_money').val();
                if (username == "") {
                    alert("please input username！");
                    return;
                }
                if (money == "") {
                    alert("please input money！");
                    return;
                }
                $('#charge').val("is being processed").attr("disabled", "disabled");
                $.ajax({
                    type: 'POST',
                    url: 'Handler.ashx',
                    data: { userName: username, Money: money },
                    dataType: 'text',
                    success: function (ret) { $('#Msg').append(ret + "</br>"); $('#charge').val("charge").attr("disabled", false); },
                    error: function (err) {
                        alert(err);
                        $('#charge').val("charge").attr("disabled", false);
                    }
                });
            }

            var admin = {};
            admin.ui = {};
            admin.config = {};
            admin.ui.iframeurl = "";
            // 输出 iframe 框架
            admin.ui.outputIframe = function () {
                var scrolling = $.isIE6 == true ? 'yes' : 'auto';
                document.write('<iframe id="content" width="100%" height="100%" class="hide" marginwidth="0" marginheight="0" frameborder="0" scrolling="' + scrolling + '" onload="$(\'#loading\').hide();$(this).show();" src=""></iframe>');
            };
            // 打开一个地址
            admin.ui.goUrl = function () {
                var url = admin.ui.iframeurl;
                if (url != '') {
                    $('#loading').show();
                    $('#content').hide().attr('src', url + (url.indexOf('?') == -1 ? '?' : '&') + Math.random());
                }
            };

            $(function () {
                $("#btn_post").click(function () { dopost(); });
                $("#btn_open").click(function () { doopen(); });
                $("#btn_openbox").click(function () { doopenbox(); });
                $.ajax({
                    type: 'POST',
                    url: '/home/DataBind',
                    data: {},
                    dataType: 'json',
                    success: function (ret) { $.each(ret.data, function (idx, item) { $('#msglist').append('<ul><li id="' + item.ID + '_' + item.SubId + '">' + item.Name + '</li></ul>'); }); },
                    error: function (err) {
                        alert(err);
                    }
                });
               
            });
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<div id="msglist"><ul><li id="1_12">Item 1</li></ul>
</div>
    <div class="outer_div">
        <div class="box_contain_blue">
            <div class="box_title_blue">
                welcome to css place</div>
            <div class="box_cont_blue">
                <p class="box_ico_friend">
                </p>
                <p>
                    maybe
                </p>
                <p>
                    this is the best way
                </p>
                <p>
                    <input type="text" id="txt_UserName" />
                    <a href="javascript:;" tabindex="17" class="btn_green" id="btn_post"><em>Submit</em></a>
                </p>
                   <p>
                    <input type="text" id="txt_url" />
                    <a href="javascript:;" tabindex="17" class="btn_green" id="btn_open"><em>打开页面</em></a>
                </p>
                    <p>                  
                    <a href="javascript:;" tabindex="17" class="btn_green" id="btn_openbox"><em>打开Box页面</em></a>
                </p>
                <p id="login-tip">
                </p>
            </div>
        </div>
    </div>
     <div id="loading">loading</div>
    <script type="text/javascript">
        admin.ui.outputIframe();
                </script>
    <div class="box_foot_blue">
        <p>
            Css美工. <a href="http://asp.net/mvc" title="ASP.NET MVC 网站">http://asp.net/mvc</a>。
        </p>
    </div>
    <script type="text/javascript">
           
    </script>
</asp:Content>
